#!bin/sh

SR_DIR="/service_register"
SP1_DIR="/service_provider1"
SP2_DIR="/service_provider2"
CLI_DIR="/client"
CLI_DIR2="/client2"
CLI_DIR3="/client3"
CLI_DIR4="/client4"
CLI_DIR5="/client5"

IP_SERVICE_REGISTER="127.0.0.1"
PORTA_SERVICE_REGISTER="4000"

sleep 1
cd .$SR_DIR
./ServiceRegister $IP_SERVICE_REGISTER $PORTA_SERVICE_REGISTER &
#gnome-terminal --title="Service Register" --working-directory=$PWD$SR_DIR --command="./ServiceRegister "$IP_SERVICE_REGISTER" "$PORTA_SERVICE_REGISTER 
sleep 1

cd ..$SP2_DIR
./ServiceProvider2 $IP_SERVICE_REGISTER $PORTA_SERVICE_REGISTER Storage_Image Get_Image Get_List &
#gnome-terminal --title="Service Provider 2" --working-directory=$PWD$SP2_DIR --command="./ServiceProvider2 "$IP_SERVICE_REGISTER" "$PORTA_SERVICE_REGISTER" Storage_Image Get_Image Get_List"

sleep 1
cd ..$SP1_DIR 
./ServiceProvider1 $IP_SERVICE_REGISTER $PORTA_SERVICE_REGISTER Horizontal_Flip_Image Rotate_Image &
#gnome-terminal --title="Service Provider 1" --working-directory=$PWD$SP1_DIR --command="./ServiceProvider1 "$IP_SERVICE_REGISTER" "$PORTA_SERVICE_REGISTER" Horizontal_Flip_Image Rotate_Image"
sleep 3
cd ..$CLI_DIR 
./client $IP_SERVICE_REGISTER $PORTA_SERVICE_REGISTER &
#gnome-terminal --title="Client" --working-directory=$PWD$CLI_DIR --command="./client "$IP_SERVICE_REGISTER" "$PORTA_SERVICE_REGISTER
sleep 1
cd ..$CLI_DIR2 
./client $IP_SERVICE_REGISTER $PORTA_SERVICE_REGISTER &
#gnome-terminal --title="Client2" --working-directory=$PWD$CLI_DIR2 --command="./client "$IP_SERVICE_REGISTER" "$PORTA_SERVICE_REGISTER
sleep 1
cd ..$CLI_DIR3 
./client $IP_SERVICE_REGISTER $PORTA_SERVICE_REGISTER &
#gnome-terminal --title="Client3" --working-directory=$PWD$CLI_DIR3 --command="./client "$IP_SERVICE_REGISTER" "$PORTA_SERVICE_REGISTER
sleep 1
cd ..$CLI_DIR4 
./client $IP_SERVICE_REGISTER $PORTA_SERVICE_REGISTER &
#gnome-terminal --title="Client4" --working-directory=$PWD$CLI_DIR4 --command="./client "$IP_SERVICE_REGISTER" "$PORTA_SERVICE_REGISTER
sleep 1
cd ..$CLI_DIR5 
./client $IP_SERVICE_REGISTER $PORTA_SERVICE_REGISTER &
#gnome-terminal --title="Client5" --working-directory=$PWD$CLI_DIR5 --command="./client "$IP_SERVICE_REGISTER" "$PORTA_SERVICE_REGISTER
